<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [1,2,3,1,2,3,4,5,6,7,4,1,4,3,2]
        for(var i=0;i<arr.length-1;i++){
            for(var j=i+1;j<arr.length;j++){
                if(arr[i] === arr[j]){
                    arr.splice(j,1)
                    j--
                }
            }
        }
        console.log(arr);
        
        var obj = {}
        var obj1 = {}
        var arr1 = []
        var arr2 = []
        for(var key in arr){
            if(obj[arr[key]] == undefined){
                obj[arr[key]] = 1;
                arr1.push(arr[key])
            }
        }
        console.log(arr1)

        for(var i=0;i<arr.length;i++){
            if(obj1[arr[i]] == undefined){
                obj1[arr[i]] = 1;
                arr2.push(arr[i])
            }
        }
        console.log(arr2)

        var arr3 = Array.from(new Set(arr));
        console.log(arr3)
    </script>
</body>
</html>